function _random(min, max) {
    return Math.floor(Math.random() * (max - min) + min)
}
let arr = [7, 1, 1, 11, 12, 4, 16, 12, 1, 17, 9, 8, 13, 15, 12, 17, 10, 18, 6, 1]
let arr1 = [7, 1, 11, 12, 9, 8, 13, 15]
// 乱序sort最简单
// arr.sort(() => Math.random() - 0.5)

Array.prototype.shuffle = function () {
    var array = this;
    var m = array.length
    var i

    while (m) {
        i = Math.floor(Math.random() * m--);
        [array[m], array[i]] = [array[i], array[m]];
    }
    return array;
}
console.log(arr1.shuffle())
